#include <QtPlugin>
#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QSpinBox>
#include <QComboBox>

#include <opencv/cv.h>
#include <opencv/highgui.h>

#include "QCVModuleInterface.h"
#include "QCVModuleHandlerInterface.h"

#include "LBP.h"

#ifndef MODULE_LBP
#define MODULE_LBP

/**
@class ModuleLBP
@brief Module de d'extraction de caractéristiques locales (LBP:Local Binary Pattern)
*/

class ModuleLBP:public QObject,QCVModuleInterface
{
  Q_OBJECT
	Q_INTERFACES(QCVModuleInterface)
	
	public:
		void init(QCVModuleHandlerInterface * parent);
		void free();
		cv::Mat & process();
		void setInput(int n,const cv::Mat & m);
		QWidget* widget();
		QString getName();
		int nbInputs();
		QString help(int id);

		bool setParams(QString params);
		QString getParams();
		QCVModuleInterface * clone();

	private slots:
		void s_initLBP(int n);

  private:

		QWidget * win;
		QComboBox * mode;
		QSpinBox * sb_rayon,* sb_nombre;
    QVBoxLayout * layout;

		LBP * lbp;

		//inputs	
		cv::Mat image;
		cv::Mat_<float> keyspoints;
		
		//outputs
		cv::Mat_<float> hist;
		cv::Mat_<float>	descriptors;

    QCVModuleHandlerInterface * parent;
};

#endif
